#include "VectorProjection.h"


VectorProjection::VectorProjection(void) : Filter(2,1)
{
}


VectorProjection::~VectorProjection(void)
{
}

void VectorProjection::Process()
{
	float *in0 = inputs[0]->ptr<float>(0);
	float *in1 = inputs[1]->ptr<float>(0);
	
	cv::Vec3f p(in0[0], in0[1], in0[2]);
	cv::Vec3f v(in1[0], in1[1], in1[2]);

	cv::Vec3f q = p - p[2] * v / v[2];

	outputs[0] = (cv::Mat_<float>(1,2) << q[0], q[1]);
}
